import React from 'react';
import { Input as TaroInput } from '@tarojs/components';

interface InputProps {
  value?: any;
  onChange?: (value: any) => void;
  placeholder?: string;
}

const Input: React.FC<InputProps> = (props) => {
  const { value, onChange, placeholder } = props;

  const handleChange = (e) => {
    onChange && onChange(e.detail.value);
  };

  return (
    <TaroInput
      value={value}
      onInput={handleChange}
      placeholder={placeholder}
      className='taro-form-input'
    />
  );
};

export default Input;
